home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / toasterpaint / negative.rexx < prev    next >
OS/2 REXX Batch file  |  1995-12-27  |  3KB  |  126 lines

  1. /* Negitive.rexx V2.0 -- Make a pic or clip Negitive */
  2. /* By Bob Caron © 1995 NewTek Inc.                   */
  3. /* Originaly by Arnie Cachelin                       */
  4.  
  5. parse arg InClipName","OutClipName","StartField","EndField
  6.  
  7. Address "DigiPaint"
  8. options results
  9.  
  10.  
  11. screen=0
  12. if inclipname="" & outclipname="" then screen=1
  13. if screen=1 then do
  14.    startfield=1
  15.    endfield=1
  16.    outclipname="Test"
  17.    end
  18.  
  19. IFFBaseName=OutClipName
  20.  
  21. if ~show('l','rexxsupport.library') then do
  22.   if ~addlib('rexxsupport.library',0,-30,34) then do
  23.     exit
  24.   end
  25. end
  26.  
  27. /* Reset Paint */
  28. 'Pmcl'
  29. 'Pot0' 0
  30. 'Pot1' 0
  31. 'Poth' $8000
  32. 'Potv' $8000
  33. 'Spoh' $8000
  34. 'Spov'
  35. /* End Of Reset*/
  36.  
  37. PageWide=752
  38. PageHigh=480
  39. dots=0
  40. XWin = 100
  41. YWin = 40
  42. Clear = d2c(12)
  43. nv = ''
  44. cr = '0a'x
  45. call getfontsize
  46.  
  47. wid = width*48
  48. hei = theight+height*10
  49.  
  50. if screen=0 then do
  51.    if ~open('Window','RAW:'XWin'/'YWin'/'wid'/'hei'/Negitive Script V2.0 - CTRL-C to Abort/NOSIZE/SCREEN 'ps,'W') then do
  52.        exit
  53.    end
  54. end
  55.  
  56. do Frame = StartField to (StartField+(EndField-StartField)/2)
  57.   if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  58.   if screen=0 then 'Gnfd'          /* Get the next field to process          */
  59.   call filter()                    /* Do The filter Thing...                 */
  60.   if screen=0 then 'Apfc'          /* Apeend the field to clip               */
  61.   if screen=0 then 'Gnfd'          /* Get the next field to process          */
  62.   if screen=0 then call filter()   /* If this is a flyer clip do other field */
  63.   if screen=0 then 'Apfc'          /* Apeend the field to clip               */
  64.   if screen=1 then 'Shco'          /* Render To Buffer (if this is screen processing)*/
  65.   end
  66. if screen=0 then 'Iclp'            /* Add an flyer icon to this clip */
  67. exit
  68.  
  69. filter:  /* Do a filter */
  70.  
  71. if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  72. '8rgb' 255 255 255  /* White color */
  73. 'Pmxo'          /* XOR Mode */
  74. if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  75. 'Hvof'          /* Set to radial gradient off */
  76. 'Maxe'          /* Set Edge transparency to 100% */
  77. if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  78. 'Whsc'          /* Fill Whole Screen */
  79.  
  80. return
  81.  
  82.  
  83. OpenWindow:
  84. parse arg InclipName,OutClipName,currentframe,EndFrame,Frame
  85.   pdots="...."
  86.   dots=dots+1
  87.   if dots>4 then dots=1
  88.   call writech('Window',Clear||nv||cr)
  89.   call writech('Window','Current Source Clip ['InClipName']'cr)
  90.   call writech('Window','  Current Dest Clip ['OutClipName']'cr)
  91.   call writech('Window',''cr)
  92.   call writech('Window','Current Frame: 'Frame/2''cr)
  93.   call writech('Window','    End Frame:'EndFrame/2''cr)
  94.   call writech('Window',''cr)
  95.   call writech('Window','Processing'right(pdots,dots)||cr)
  96.  
  97. return
  98.  
  99.  
  100. getfontsize:
  101.  
  102. if open('font','env:sys/font.prefs','R') then do
  103.    font = readch('font',word(statef('env:sys/font.prefs'),2))
  104.    call close('font')
  105.    font = substr(font,index(font,'FONT')+4)
  106.    font = substr(font,index(font,'FONT')+4)
  107.    height = c2d(substr(font,29,2))
  108.    tfont = substr(font,index(font,'FONT')+4)
  109.    theight = c2d(substr(tfont,29,2))
  110.    font = substr(font,33)
  111.    font = left(font,index(font,d2c(0))-1-5)
  112.    if open('font','FONTS:'font'/'height,'R') then do
  113.       width = c2d(right(readch('font',116),2))
  114.       call close('font')
  115.   end
  116.   else if height=9 then width = 10
  117.                    else width = 8
  118. end
  119.   else do
  120.   theight = 8
  121.   height = 8
  122.   width = 8
  123. end
  124.  
  125. return
  126.